<audio id="a_jump" src="/music/media/jump.mp3"></audio>
<audio id="a_cart" src="/music/media/cart.mp3"></audio>
<audio id="a_zan" src="/music/media/zan.mp3"></audio>
<audio src="/music/media/btn.mp3" id="a_btn"></audio>

<script>
    var jump_audio = document.getElementById("a_jump");
    var cart_audio = document.getElementById("a_cart");
    var zan_audio = document.getElementById("a_zan");
    var btn_audio = document.getElementById("a_btn");

    var isAudio = false
    var fixaudio = function () {
        if (!isAudio) {
            isAudio = true;

            var a = new Audio();
            a.src = "/music/media/jump.mp3";
            var b = new Audio();
            b.src = "/music/media/cart.mp3";
            var c = new Audio();
            c.src = "/music/media/zan.mp3";
            var d = new Audio();
            d.src = "/music/media/btn.mp3";


            jump_audio.load();
            cart_audio.load();
            zan_audio.load();
            btn_audio.load();
            $("document").off("tap");
        }
    };
    $("document").on("tap", function () {
        fixaudio();
    })

    $("document").trigger("tap");


    var playJump = function () {
        cart_audio.pause();
        jump_audio.pause();
        jump_audio.load()
        jump_audio.play();
    }

    var playCart = function () {
        cart_audio.pause();
        cart_audio.load()
        cart_audio.play();
    }

    var playZan = function () {
        zan_audio.pause();
        zan_audio.load()
        zan_audio.play();
    }

    var playBtn = function (cb) {
        btn_audio.pause();
        btn_audio.load()
        btn_audio.play();

        $("#a_btn").on("ended", function () {
            cb && cb();
        });
    }
</script>